if __name__ == '__main__':
    yanghui = []
    count = int(input("请输入杨辉三角形的行数"))
    # 计算杨辉三角形数据
    # 构建杨辉三角形外形
    i = 1
    while i <= count:
        temp = []
        j = 0
        while j < i:
            temp.append(1)
            j = j + 1
        yanghui.append(temp)

        # 输出杨辉三角形
        i = i + 1

    # 构建杨辉三角形数据
    i = 2
    while i < count:
        j = 1
        while j < i:
            yanghui[i][j] = yanghui[i - 1][j] + yanghui[i - 1][j - 1]
            j = j + 1
        i = i + 1

    i = 0
    while i < count:
        print(yanghui[i])
        i = i + 1
